package leetcodecompetition.S112;

/**
 * @Author: Siantar
 * @Date: 2023-09-02-22:41
 * @Description: 1.0
 */
public class T7005 {
    public boolean checkStrings(String s1, String s2) {
        int[][] cnt = new int[2][26];
        for (int i = 0; i < s1.length(); i++) {
            cnt[i % 2][s1.charAt(i)-'a']++;
        }
        for (int i = 0; i < s2.length(); i++) {
            if (cnt[i % 2][s2.charAt(i)-'a']<= 0) return false;
            cnt[i % 2][s2.charAt(i)-'a']--;
        }
        return true;
    }
}
